import 'package:flutter/material.dart';
import 'package:grint/widget/report_dialog.dart';

class JubaoBangzhu {
  static void jubaoYonghu(
    BuildContext context, {
    required String yonghuId,
    String? yonghuMing,
  }) {
    FankuiTanchuangBangzhu.xianshi(
      context,
      mubiaoyonghuId: yonghuId,
      onJubao: (jubaoLeixing, fujiaxinxi) {
        _chuliYonghuJubao(
          yonghuId: yonghuId,
          yonghuMing: yonghuMing,
          jubaoLeixing: jubaoLeixing,
          fujiaxinxi: fujiaxinxi,
        );
      },
    );
  }

  static void jubaoNeirong(
    BuildContext context, {
    required String neirongId,
    String? zuozheId,
    String? neirongLeixing,
  }) {
    FankuiTanchuangBangzhu.xianshi(
      context,
      mubiaoNeirongId: neirongId,
      mubiaoyonghuId: zuozheId,
      onJubao: (jubaoLeixing, fujiaxinxi) {
        _chuliNeirongJubao(
          neirongId: neirongId,
          zuozheId: zuozheId,
          neirongLeixing: neirongLeixing,
          jubaoLeixing: jubaoLeixing,
          fujiaxinxi: fujiaxinxi,
        );
      },
    );
  }

  static void _chuliYonghuJubao({
    required String yonghuId,
    String? yonghuMing,
    required JubaoLeixing jubaoLeixing,
    String? fujiaxinxi,
  }) {
    if (jubaoLeixing == JubaoLeixing.block) {
      _laheiYonghu(yonghuId);
    }
  }

  /// 处理内容举报
  static void _chuliNeirongJubao({
    required String neirongId,
    String? zuozheId,
    String? neirongLeixing,
    required JubaoLeixing jubaoLeixing,
    String? fujiaxinxi,
  }) {}

  static void _laheiYonghu(String yonghuId) {}
}

class JubaoShiyongShili {
  static void zaiLiaotianYemianJubaoYonghu(
    BuildContext context,
    String yonghuId,
  ) {
    JubaoBangzhu.jubaoYonghu(
      context,
      yonghuId: yonghuId,
      yonghuMing: 'Johnson',
    );
  }

  static void zaiFenxiangXiangqingJubaoNeirong(
    BuildContext context,
    String neirongId,
  ) {
    JubaoBangzhu.jubaoNeirong(
      context,
      neirongId: neirongId,
      zuozheId: '1001',
      neirongLeixing: 'share_content',
    );
  }

  static void zaiPinglunJubaoYonghu(BuildContext context, String yonghuId) {
    JubaoBangzhu.jubaoYonghu(context, yonghuId: yonghuId);
  }
}
